﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BookTransactionModels;
using BookTransactionControllers.Services_Impl;
using System.Data.SqlClient;

public partial class Views_Register : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnRegister_Click(object sender, EventArgs e)
    {
        UserBean user = new UserBean();
        user.FullName = txtFullName.Text;
        user.Password = txtPassword.Text;
        user.ID = txtID.Text;
        UserManagerImpl userManagerImpl = new UserManagerImpl();
        userManagerImpl.Insert(user);
    }
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        String UserID = txtUserID.Text;
        SqlCommand command = new SqlCommand();
        command.CommandText = String.Format("Delete [User] Where [ID] = '{0}'",UserID);
        UserManagerImpl userManagerImpl = new UserManagerImpl();
        userManagerImpl.Delete(command);
    }
}